cmake_minimum_required(VERSION 3.0.0)
project(Synchronizer VERSION 0.1.0)

include(CTest)
enable_testing()

set ( PRJ_SRC_LIST )

set(sh_inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/Synchronizer/include)
set(sh_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/Synchronizer/src)
set(LIBSY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build)
set(LIBEV_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libev)
set(LIBEVSO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libev/.libs)
file ( GLOB root_src_files "${sh_src_dir}/*.c" )
list ( APPEND PRJ_SRC_LIST ${root_src_files} )
include_directories(${sh_inc_dir} ${LIBEV_DIR})

add_library(sy SHARED ${PRJ_SRC_LIST})

link_directories(${LIBSY_DIR} ${LIBEVSO_DIR})
link_libraries(libev.so libsy.so)

add_executable(Synchronizer main.cpp)
target_link_libraries(Synchronizer libsy.so libev.so)


set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION} ${sh_inc_dir})
include(CPack)
